<%@ page language="java"
		 pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="Xenon Boostrap Admin Panel" />
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">

<title>广州爱机汽车配件有效公司</title>

<!-- 引用新样式 start -->
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>css/new/bootstrap.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>css/new/style.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>css/new/reset.css" />
<!-- end -->
<style type="text/css">
.stay{
	text-decoration:none;
}
</style>
<script type="text/javascript"
		src="<%=basePath%>js/new/jquery.min.js"></script>
		<script type="text/javascript"
		src="<%=basePath%>js/new/bootstrap.min.js"></script>
		<script type="text/javascript"
		src="<%=basePath%>js/new/bootstrap.js"></script>
<script>
    $(function(){
        /**一级菜单收缩展示**/
        $(".group-list-item").on("click",function () {
            $(this).parent().next().toggle()
            $(".group-list-item").children("em").toggleClass('group-list-item-ico-up')
        })
        /** 给当前list的a添加颜色类**/
      $(".group-list-item-list").on("click",function (e) {
         	//console.log(e)
         	$(".group-list-item-list").removeClass('navbar-default')
    		$(this).addClass('navbar-default').siblings("").removeClass('navbar-default');
         	//$(".group-list-item-list").removeClass('navbar-default')
     })
    });
    
    $(function(){
    	//加载首页
    	//$("#myWindow").attr("src","/mpts/bus/index/index");
    	//退出登录
        $("#logout").click(function(){
          	window.location.href="<%=basePath%>logout";
    	});
       /*  $(".group-item-ul li a").click(function(){
        	$("#myWindow").attr("src",$(this).attr("href"));
        	return false;
    	}); */
        $(".group-list-item-list").click(function(){
        	if($(this).html() == '大屏展示'){
        		window.open($(this).attr("href"),'new',' left=0,top=0,width='+ (screen.availWidth - 10) +',height='+ (screen.availHeight-50) +',scrollbars,resizable=yes,toolbar=no');//如果菜单为大屏展示则新窗口打开
        	}else{
        		$("#myWindow").attr("src",$(this).attr("href"));
        	}
        	return false;
    	});
    });
</script>

</head>
<body style="background-color:#f3f3f4">
 <%-- Language:
    <a href="<%=basePath%>?lang=zh_CN"><spring:message code="language.cn"/></a> &nbsp;&nbsp;&nbsp;
    <a href="<%=basePath%>?lang=en_US"><spring:message code="language.en"/></a>
    <h1>
        <spring:message code="welcome"/>
    </h1>
    当前语言: ${pageContext.response.locale } --%>
	<div class="index-bg container" style="width: 100%">
		<div class="container container-reset" style="padding-left: 0px;padding-right:0px">
			<div class="row" style="margin-left:0px;margin-right:0px">
				<div class="navbar-default index-nav">
					<img src="<%=basePath%>/images/new/logo_index.png" alt="">
                			<span style = "float:right;margin-right:20px"><img src="images/user-4.png" alt="user-image" class="img-circle img-inline userpic-32" width="28" />
                			<span>当前用户：${admin.username}</span>
                			<span style="cursor:pointer " id = "logout">退出</span></span>
				</div>
			</div>
			<div class="row" style="width:100%;margin-left:0px;margin-right:0px;height:800px;">
				<div class="col-md-2 col-lg-2 index-nav-left-con" style="width: 16% !important; padding-left:10px !important; padding-right:0px;height:800px;float:left">
					<div class="index-nav-left" style="height:800px;width: 150px;">
						<ul class="index-nav-left-group">
						<c:forEach items="${menuList}" var="menu">
							<li class="group-item group-item-one">
							<c:choose>
        						<c:when test="${menu.children.size()>0}">
        							<a href="javascript:void(0);" class="group-list-item"><span>${menu.name}</span><em class="group-list-item-ico-down"></em></a>
        						</c:when>
          						<c:otherwise>
          							<a  class="group-list-item-list stay" href="<%=path%>${menu.url}" <c:if test = "${menu.name=='大屏展示'}">target="blank"</c:if> >${menu.name}</a>
          						</c:otherwise>
        					</c:choose>
        					<c:if test="${menu.children.size()>0}">
        						<li class="group-item">
        							<ul class="group-item-ul">
        					</c:if>
          						<c:forEach items="${menu.children}" var="m">
          							<li>
            						<c:choose>
            							<c:when test="${m.children.size()>0}">
            								<a href="javascript:void(0);" class="group-list-item-list navbar-default">${m.name}</a>
              							</c:when>
              						<c:otherwise>
              								<a class="group-list-item-list stay" href="<%=path%>${m.url}"<c:if test = "${menu.name=='大屏展示'}">target="blank"</c:if>>${m.name}</a>
              						</c:otherwise>
            						</c:choose> 
          						</li> 
          					</c:forEach>
        					<c:if test="${menu.children.size()>0}">  
        							</ul>
        						</li>
        					</c:if>
        					</li>
						</c:forEach>
                       	</ul>
					</div>
				</div>
				
				
				
				<div style="float:right;width:84%;margin-top:5px"><iframe id="myWindow" src="" width="100%" height="1200px" scrolling="no" frameborder="0"> </iframe></div>
				
				
				
			</div>
		</div>
		
	</div>
</body>
</html>